package cn.wqb.bpp.common.utils;

import org.apache.log4j.Logger;
import java.util.HashMap;
import java.util.Map;

public class LogUtils extends Logger {

    private static Map<String, Logger> classMap = new HashMap<>();

    protected LogUtils(String name) {
        super(name);
    }

    public static Logger instance(Object clazz) {
        Class c = clazz.getClass();
        if(classMap.containsKey(c.getSimpleName())){
            return classMap.get(c.getSimpleName());
        }
        Logger logger = Logger.getLogger(c);
        classMap.put(c.getSimpleName(), logger);
        return logger;
    }

}
